Skip to content

Fix for CreateTable not always adding missing columns#21

Merged
garthmz merged 3 commits into
mainfrom
user/garth/migrate
Jun 28, 2024
Merged

Fix for CreateTable not always adding missing columns#21
garthmz merged 3 commits into
mainfrom
user/garth/migrate

Conversation

@garthmz

@garthmz garthmz commented Jun 28, 2024

Copy link
Copy Markdown

This would happen when a previous INSERT/UPDATE/DELETE statement query modified rows. The existing code was incorrectly attempting to check whether a CREATE IF NOT EXISTS statement did anything.
https://www.sqlite.org/c3ref/changes.html

garthmz added 3 commits May 30, 2024 17:12
This would happen when a previous INSERT/UPDATE/DELETE statement
query modified rows.  The existing code was incorrectly attempting
to check whether a CREATE IF NOT EXISTS statement did anything.
https://www.sqlite.org/c3ref/changes.html
MigrateTable(map);
}
// add columns if necessary
MigrateTable(map);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this safely no-op?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's an empty for loop. In fact, if you read the old comment, this was known to be happening when they didn't want it to.

@garthmz garthmz enabled auto-merge (rebase) June 28, 2024 20:05

@dustinmz dustinmz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@garthmz garthmz merged commit 11ecdb7 into main Jun 28, 2024
@garthmz garthmz deleted the user/garth/migrate branch June 28, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants